
function widthProfileGUI(suppData)

    curFrame = 1;
    nFrames = length(suppData);
    fw = figure('Name','Width Profile Analysis','NumberTitle','off');
    scrsz = get(0,'ScreenSize');
    set(fw,'Position',[1 1 0.9*scrsz(3) 0.9*scrsz(4)]);


    bh1 = uicontrol(fw,'Position',[600 100 60 30],...
                    'String','Next',...
                    'Callback',@button_next);


    bh2 = uicontrol(fw,'Position',[680 100 60 30],...
                    'String','Previous',...
                    'Callback',@button_previous);   

    ax1 = axes('Parent',fw,'units','pixels',...
               'Position',[25 220 500 700]);
    ax2 = axes('Parent',fw,'units','pixels',...
               'Position',[550 220 700 500]);
       
    imshow(suppData(curFrame).BwImage, 'Parent', ax1);
    showWidthProfile(ax2, suppData, curFrame); 
 %------------------------------------------------
  
   function button_next(hObject,eventdata)
        if curFrame ~= nFrames
           curFrame = curFrame + 1;
       end
       imshow(suppData(curFrame).BwImage, 'Parent', ax1);
       showWidthProfile(ax2, suppData, curFrame);
   end
   %------------------------------------------------
   function button_previous(hObject,eventdata)
       if curFrame ~= 1
           curFrame = curFrame - 1;
       end
       imshow(suppData(curFrame).BwImage, 'Parent', ax1);
       showWidthProfile(ax2, suppData, curFrame);
   end


      
end



